package com.huawei.controller;

import com.huawei.domain.ResponseResult;
import com.huawei.entity.Users;
import com.huawei.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private ILoginService ils;

    @PostMapping("/user/login")
    public ResponseResult login(@RequestBody Users user){
        System.out.println("开始登录中……");
        return ils.login(user);
    }

    @PostMapping("/user/logout")
    public ResponseResult logout(){
        return ils.logout();
    }
}
